package app.beit.finportal.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

import app.beit.finportal.entity.MSConfig;

public class MSConfigDao {

	@Autowired
	private SessionFactory sessionFactory;
	
	public MSConfig getByName(final String name) throws Exception{
		final Session session = this.sessionFactory.openSession();
		final MSConfig result = (MSConfig) session.createQuery("from MSConfig n where n.name='" + name + "' ").uniqueResult();
		session.close();
		
		return result;
	}
}
